Optimal. Leaf size=108 \[ -\frac {(B-4 C) \tan (c+d x)}{3 a^2 d}+\frac {(B-2 C) \tanh ^{-1}(\sin (c+d x))}{a^2 d}-\frac {(B-2 C) \tan (c+d x)}{a^2 d (\sec (c+d x)+1)}+\frac {(B-C) \tan (c+d x) \sec ^2(c+d x)}{3 d (a \sec (c+d x)+a)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.34, antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.175, Rules used = {4072, 4019, 4008, 3787, 3770, 3767, 8} \[ -\frac {(B-4 C) \tan (c+d x)}{3 a^2 d}+\frac {(B-2 C) \tanh ^{-1}(\sin (c+d x))}{a^2 d}-\frac {(B-2 C) \tan (c+d x)}{a^2 d (\sec (c+d x)+1)}+\frac {(B-C) \tan (c+d x) \sec ^2(c+d x)}{3 d (a \sec (c+d x)+a)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3767
Rule 3770
Rule 3787
Rule 4008
Rule 4019
Rule 4072
Rubi steps
\begin {align*} \int \frac {\sec ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{(a+a \sec (c+d x))^2} \, dx &=\int \frac {\sec ^3(c+d x) (B+C \sec (c+d x))}{(a+a \sec (c+d x))^2} \, dx\\ &=\frac {(B-C) \sec ^2(c+d x) \tan (c+d x)}{3 d (a+a \sec (c+d x))^2}+\frac {\int \frac {\sec ^2(c+d x) (2 a (B-C)-a (B-4 C) \sec (c+d x))}{a+a \sec (c+d x)} \, dx}{3 a^2}\\ &=-\frac {(B-2 C) \tan (c+d x)}{a^2 d (1+\sec (c+d x))}+\frac {(B-C) \sec ^2(c+d x) \tan (c+d x)}{3 d (a+a \sec (c+d x))^2}-\frac {\int \sec (c+d x) \left (-3 a^2 (B-2 C)+a^2 (B-4 C) \sec (c+d x)\right ) \, dx}{3 a^4}\\ &=-\frac {(B-2 C) \tan (c+d x)}{a^2 d (1+\sec (c+d x))}+\frac {(B-C) \sec ^2(c+d x) \tan (c+d x)}{3 d (a+a \sec (c+d x))^2}-\frac {(B-4 C) \int \sec ^2(c+d x) \, dx}{3 a^2}+\frac {(B-2 C) \int \sec (c+d x) \, dx}{a^2}\\ &=\frac {(B-2 C) \tanh ^{-1}(\sin (c+d x))}{a^2 d}-\frac {(B-2 C) \tan (c+d x)}{a^2 d (1+\sec (c+d x))}+\frac {(B-C) \sec ^2(c+d x) \tan (c+d x)}{3 d (a+a \sec (c+d x))^2}+\frac {(B-4 C) \operatorname {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{3 a^2 d}\\ &=\frac {(B-2 C) \tanh ^{-1}(\sin (c+d x))}{a^2 d}-\frac {(B-4 C) \tan (c+d x)}{3 a^2 d}-\frac {(B-2 C) \tan (c+d x)}{a^2 d (1+\sec (c+d x))}+\frac {(B-C) \sec ^2(c+d x) \tan (c+d x)}{3 d (a+a \sec (c+d x))^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 1.14, size = 245, normalized size = 2.27 \[ \frac {\cos ^2\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x) \left ((4 B-7 C) \tan ^3\left (\frac {1}{2} (c+d x)\right )+(13 C-4 B) \tan \left (\frac {1}{2} (c+d x)\right )+16 (B-C) \sin ^8\left (\frac {1}{2} (c+d x)\right ) \csc ^5(c+d x)-4 (B-C) \sin ^4\left (\frac {1}{2} (c+d x)\right ) \csc ^3(c+d x)-3 (B-2 C) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )\right )+3 (B-2 C) \tan ^2\left (\frac {1}{2} (c+d x)\right ) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )\right )\right )}{3 a^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.47, size = 195, normalized size = 1.81 \[ \frac {3 \, {\left ({\left (B - 2 \, C\right )} \cos \left (d x + c\right )^{3} + 2 \, {\left (B - 2 \, C\right )} \cos \left (d x + c\right )^{2} + {\left (B - 2 \, C\right )} \cos \left (d x + c\right )\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left ({\left (B - 2 \, C\right )} \cos \left (d x + c\right )^{3} + 2 \, {\left (B - 2 \, C\right )} \cos \left (d x + c\right )^{2} + {\left (B - 2 \, C\right )} \cos \left (d x + c\right )\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (2 \, {\left (2 \, B - 5 \, C\right )} \cos \left (d x + c\right )^{2} + {\left (5 \, B - 14 \, C\right )} \cos \left (d x + c\right ) - 3 \, C\right )} \sin \left (d x + c\right )}{6 \, {\left (a^{2} d \cos \left (d x + c\right )^{3} + 2 \, a^{2} d \cos \left (d x + c\right )^{2} + a^{2} d \cos \left (d x + c\right )\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.27, size = 151, normalized size = 1.40 \[ \frac {\frac {6 \, {\left (B - 2 \, C\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a^{2}} - \frac {6 \, {\left (B - 2 \, C\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a^{2}} - \frac {12 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} a^{2}} - \frac {B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 9 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 15 \, C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{6}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.67, size = 205, normalized size = 1.90 \[ -\frac {B \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d \,a^{2}}+\frac {C \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d \,a^{2}}-\frac {3 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d \,a^{2}}+\frac {5 C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d \,a^{2}}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) B}{d \,a^{2}}+\frac {2 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) C}{d \,a^{2}}-\frac {C}{d \,a^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) B}{d \,a^{2}}-\frac {2 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) C}{d \,a^{2}}-\frac {C}{d \,a^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.35, size = 244, normalized size = 2.26 \[ \frac {C {\left (\frac {\frac {15 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {12 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a^{2}} + \frac {12 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a^{2}} + \frac {12 \, \sin \left (d x + c\right )}{{\left (a^{2} - \frac {a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} - B {\left (\frac {\frac {9 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {6 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a^{2}} + \frac {6 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a^{2}}\right )}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.86, size = 120, normalized size = 1.11 \[ \frac {2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (B-2\,C\right )}{a^2\,d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (B-C\right )}{6\,a^2\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {B-C}{a^2}+\frac {B-3\,C}{2\,a^2}\right )}{d}-\frac {2\,C\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-a^2\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {B \sec ^{3}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \sec ^{4}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx}{a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________